<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<html>

<!-- Claudio Herreros, Dylan James, Tyler Berg -->

<head>
	<link rel="stylesheet" type="text/css" href="styles.css" title="Style 1" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Change Password</title>
		<script type="text/javascript">
			function checkFields(form)
			{
				if (form.Password == "")
				{
					alert("Please enter a password.");
					form.Password.focus();
					return false;
				}
		
				if (form.Password2 == "")
				{
					alert("Please re-enter your password.");
					form.Password2.focus();
					return false;
				}
				
				if (form.Password.value != form.Password2.value)
				{
					alert("Passwords do not match.");
					form.Password2.focus();
					return false;
				}
		
				return true;
			}
			</script>
	</head>
	<body>
		<h1>Change Password</h1>
		<a href="/SignOut" class="Signout">SignOut</a></span>
		<br/>
		<hr />
				<%
					if (request.getAttribute("errorMessage") != null)
					{
				%>
						<div style="color:red" align="center"> <strong>
						<%= request.getAttribute("errorMessage") %>
						</strong></div> <br />
				<%
					}
				%>
		<form action="/ChangePassword" method="post" onsubmit="return checkFields(this);">
			<table align="center" border="0" cellspacing="0" cellpadding="5">
				<tr>
					<td class="FieldLabel">New Password:</td>
					<td><input name="Password" type="password" value="" size="40" /></td>
				</tr>
				<tr>
					<td class="FieldLabel">Re-Enter Password:</td>
					<td><input name="Password2" type="password" value="" size="40" /></td>
				</tr>
				</table>
				<div align="center"><input type="submit" value="Change Password" /></div>
		</form>
		<hr/>
		<a href="home.jsp">Back!</a>
	</body>
</html>
